const WebSocket = require('ws');
 
const ws = new WebSocket('https://stream80.forexpros.com:443/echo',{
  //perMessageDeflate: false
});
 
ws.on('open', function open() {
  console.log("opem....");
  ws.send(JSON.stringify({
							_event : "heartbeat",
							data : "h"
						}));
});
 
ws.on('message', function incoming(data, flags) {
  // flags.binary will be set if a binary data is received. 
  // flags.masked will be set if the data was masked. 

  console.log("message",data,flags);
});